/**
 * 生成矩阵数组
 * @param {*} len
 * @param {*} val
 * @returns
 */
function buildMatrixArray(len = 0, val = 1) {
  let array = [];
  for (let i = 0; i < len; i++) {
    array[i] = [];
    for (let j = 0; j < len; j++) {
      array[i][j] = val;
    }
  }
  return array;
}

/**
 * 获取行数据
 * @param {*} arr
 * @param {*} rowIndex
 * @returns
 */
function getRow(arr, rowIndex) {
  const row = [];
  for (let index = 0; index < arr.length; index++) {
    row.push(arr[rowIndex][index]);
  }
  return row;
}

/**
 * 获取列数据
 * @param {*} arr
 * @param {*} columnIndex
 * @returns
 */
function getColumn(arr, columnIndex) {
  const column = [];
  for (let index = 0; index < arr.length; index++) {
    column.push(arr[index][columnIndex]);
  }
  return column;
}
